import axios from './axios'

/**
 *
 *{ @param {url:'http',type:get,data} params}
 */
// 封装aixos函数
const $http = (params) => {
  const { type } = params
  return new Promise((resolve, reject) => {
    if (type === 'get') {
      axios.get(params.url, {
        params: params.data || ''
      }).then(result => {
        resolve(result)
      })
    }
  })
}
// 登陆api
export const login = (params) => {
  return $http({ url: '/login/cellphone', type: 'get', data: params })
}
// 获取登陆状态
export const LoginStatus = () => {
  return $http({ url: '/login/status', type: 'get' })
}
